package com.woniu.cq.medical.dao.mymapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.cq.medical.common.PageResult;
import com.woniu.cq.medical.dao.PatientMapper;
import com.woniu.cq.medical.entity.Patient;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.context.annotation.Primary;

import java.util.Date;

/**
 * @Author: Klaus
 * @Date: 2020/9/5 15:18
 */
@Primary
public interface My_PatientMapper extends PatientMapper {

    @Select("SELECT p.patient_id,p.patient_name,p.patient_id_card,p.patient_phone_number," +
            "p.patient_address,p.patient_sex,p.patient_age,p.patient_password,p.medical_card_id," +
            "p.patient_birthday,p.patient_occupation,p.`patient_native place`," +
            "p.patient_into_time,p.patient_last_modification_time from lonbon_patient p " +
            "where p.patient_id_card = #{idCard}")
    Patient selectPatientByIdCard(String idCard);

    IPage<Patient> selectAll(Page<Patient> page, @Param("name")String name);
}
